<div id="choosePayableItemDlg" style="display: none;" title="Choose Payable Item">
	<div  class="select-payable-item form">
		<?php
		$this->widget('PsGridView', array(
			'id' => 'commissions-payable-index-grid',
			'dataProvider' => $dataProvider,
			'filter' => $payableItemSearch,
			'template' => '{items}{pager}{pagesize}',
//						'mergeColumns' => array('user.id', 'user.name'),
//						'extraRowColumns' => array('user.id', 'user.name'),
			'htmlOptions' => array(
				'class' => 'grid-view grey'
			),
			'pagerCssClass' => 'pager float-right',
			'pagesizeCssClass' => 'pager-pagesize float-right',
			'columns' => array(
				'id' => array(
					'name' => 'id',
					'type' => 'raw',
					'filter' => false,
					'value' => 'CHtml::radioButton("payable-item-id", false, array("value" => $data->id))',
					'htmlOptions' => array(
						'width' => '10px'
					),
				),
				array(
					'name' => 'payee_party_id',
					'type' => 'raw',
//					'value' => '$data->payee_party_id',
					'value' => 'CHtml::hiddenField(\'PayableItem[payee_party_id]\', $data["payee_party_id"]).
						CHtml::hiddenField(\'PayableItem[payee_name]\',$data->getPayeeName())',
					'headerHtmlOptions' => array('style' => 'width:0%; display:none'),
					'filterHtmlOptions' => array('style' => 'width:0%; display:none'),
					'htmlOptions' => array('style' => 'width:0%; display:none'),
				),
				array(
					'name' => 'payment_id',
					'type' => 'raw',
//					'value' => '$data->payment_id',
					'value' => 'CHtml::hiddenField(\'PayableItem[payment_id]\', $data["payment_id"]).
						CHtml::hiddenField(\'PayableItem[receipt_number]\', $data->payment->payment_number).
						CHtml::hiddenField(\'PayableItem[property_case_id]\', $data->propertyCase->id).
						CHtml::hiddenField(\'PayableItem[case_number]\', $data->propertyCase->case_number).
						CHtml::hiddenField(\'PayableItem[net_amount_before]\', $data->net_amount).
						CHtml::hiddenField(\'PayableItem[net_amount_total]\', $data->net_amount)',					
					'headerHtmlOptions' => array('style' => 'width:0%; display:none'),
					'filterHtmlOptions' => array('style' => 'width:0%; display:none'),
					'htmlOptions' => array('style' => 'width:0%; display:none'),
				),
				array(
					'header' => 'Payee Name',
					'name' => 'payee_name',
					'type' => 'raw',
					'value' => '$data->getPayeeName()',
//					'value' => 'CHtml::hiddenField(\'PayableItem["id"]\', $data["payee_party_id"])',
					'htmlOptions' => array(
						'width' => 300
					)
				),
				array(
					'header' => 'Related Receipt',
					'name' => 'receipt_number',
					'type' => 'raw',
					'value' => '"#".$data->payment->payment_number',
					'htmlOptions' => array(
						'width' => 50
					)
				),
				array(
					'header' => 'Transaction No.',
					'name' => 'case_number',
					'type' => 'raw',
					'value' => '"#".$data->propertyCase->case_number',
					'htmlOptions' => array(
						'width' => 50
					)
				),
				array(
					'header' => 'Tx Address',
					'name' => 'case_address',
					'type' => 'raw',
					'value' => '$data->propertyCase->property->prop_address_formatted',
					'htmlOptions' => array(
						'width' => 400
					)
				),
				array(
					'header' => 'Type',
					'name' => 'comm_type',
					'type' => 'raw',
					'filter' => PayableItem::getCommTypeListData(),
					'value' => '$data->getCommTypeFormatted()',
					'htmlOptions' => array('class' => 'comm-type-column'),
					'headerHtmlOptions' => array('class' => 'comm-type-column'),
				),
				array(
					'header' => 'Amount',
					'name' => 'net_amount',
					'type' => 'raw',
					'value' => 'Yii::app()->numberFormatter->formatCurrency($data->net_amount, $data->payment->currency_code ? $data->payment->currency_code : "$")',
					'htmlOptions' => array(
						'class' => 'align-right',
						'width' => 100
					),
					'headerHtmlOptions' => array('class' => 'align-right')
				),
//				array(
//					'header' => 'Status',
//					'value' => '$data->getStatus()',
//					'htmlOptions' => array(
//						'width' => 80
//					)
//				),
//				array(
//					'header' => 'PV No.',
//					'type' => 'raw',
//					'value' => '$data->hasPaymentVoucher() ? CHtml::link("#" . $data->paymentVoucher->payment_number, array("paymentVoucher/view", "id" => $data->payment_voucher_id), array("class" => "blue link")) : "Not issued"',
//					'htmlOptions' => array(
//						'width' => 100
//					)
//				),
//							array(
//								'header' => 'Action',
//								'type' => 'raw',
//								'value' => 'CHtml::link("<img src=\'/images/icons/fugue/magnifier-zoom-in.png\' /> View Details", 
//							array("commissionPayable/outstandingDetails","id" => $data->id))',
//								'htmlOptions' => array(
//								)
//							)
			),
		));
		?>
	</div>
</div>